#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <vector>

using namespace std;

void test1()
{
	vector<int> v1;
	vector<int> v2(10, 0);
	vector<int> v3(v2);
	vector<int> v4(v2.begin(), v2.end());
}

void test2()
{
	vector<int> v1(10, 0);
	int a = 0;
	for (auto& i : v1)
	{
		i += a;
		a++;
	}
	for (auto it = v1.begin(); it != v1.end(); ++it)
	{
		cout << *it << " ";
	}
	cout << endl;
}

void test3()
{
	vector<int> v1(10,0);
	cout << v1.size() << endl;
	cout << v1.capacity() << endl;
	cout << v1.empty() << endl;
	v1.resize(5);
	cout << v1.size() << endl;
	cout << v1.capacity() << endl;
	v1.reserve(15);
	cout << v1.size() << endl;
	cout << v1.capacity() << endl;
}

void test4()
{
	vector<int> v1(10, 0);
	v1.push_back(1);
	v1.push_back(2);
	v1.pop_back();
	v1.push_back(3);
	auto pos = find(v1.begin(), v1.end(), 3);
	v1.insert(pos, 4);
	v1.erase(v1.end() - 1);
	for (int i = 0; i < v1.size(); i++)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	vector<int> v2(10, 0);
	v1.swap(v2);
	for (int i = 0; i < v1.size(); i++)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	for (int i = 0; i < v2.size(); i++)
	{
		cout << v2[i] << " ";
	}
	cout << endl;
}
int main()
{
	test4();
	return 0;
}